﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Milan
{
	public class SettingsList
	{
		public SettingsList(string name, Settings settings)
		{
			this.name = name;
			this.settings = settings;
		}
		public SettingsList(string name)
		{
			this.name = name;
			settings = Settings.ProductUser;
		}
		public void Add(string item)
		{
			var list = Get();
			list.Add(item);
			Set(list);
		}
		public List<string> Get()
		{
			return settings.GetValues(name);
		}
		public void Set(List<string> values)
		{
			settings.SetValues(name, values);
		}
		public static implicit operator List<string>(SettingsList rhs)
		{
			return rhs.settings.GetValues(rhs.name);
		}
		private string name;
		private Settings settings;
	}
}
